function mostrar(formulario,id){
    for (i=0;i<formulario.elements.length;i++){
        if(formulario.elements[i].name == "id"){
            formulario.elements[i].value =id;
        }
        if(formulario.elements[i].name == "nombre["+id+"]"){
            formulario.elements[i].disabled=false;
        }
        if(formulario.elements[i].name == "categoria["+id+"]"){
            formulario.elements[i].disabled=false;
        }
        if(formulario.elements[i].name == "precio["+id+"]"){
            formulario.elements[i].disabled=false;
        }
        if(formulario.elements[i].name == "imagen["+id+"]"){
            formulario.elements[i].disabled=false;
        }
        if(formulario.elements[i].type == "submit"){
            if(formulario.elements[i].name != "botonguardar["+id+"]"){
                formulario.elements[i].style.display = "none";
            }
            else{
		formulario.elements[i].style.display = "";
            }
        }
        if(formulario.elements[i].type == "button"){
            if(formulario.elements[i].name != "boton["+id+"]"){
                formulario.elements[i].disabled=true;
                formulario.elements[i].style.display = "";
            }
            else{
		formulario.elements[i].style.display = "none";
            }
            if (formulario.elements[i].name == "Guardar"){
                formulario.elements[i].disabled=false;
            }
        }   
    }
}

function responder(id){
    valor = document.getElementById("cantidad["+id+"]").value;
    location.href="Sumacarro?id="+id+"&val="+valor+"&act=true"
}
function ocultar(id){
    $('#'+id).toggle('fast');
}
function ocultar_todo(){
    ocultar('cuerpo_listos');
    ocultar('cuerpo_pendientes');
}
function poner_valor(v1,v2){
    $('#'+v1).html(v2);
}